<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="/paginas/template.xhtml">

	<ui:define name="corpoForm">
		

		<f:event type="javax.faces.event.PreRenderComponentEvent"
			listener="#{manterTamanhoBean.preRenderNew}" />
		<h:form id="formNovoTamanho" prependId="false">

			<p:panelGrid columns="3" styleClass="botoes" id="botoes">
				<p:commandButton value="#{rsc.label_salvar}" styleClass="botao"
					action="#{manterTamanhoBean.salvar}" ajax="false"
					onclick="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);"
					rendered="#{p:ifGranted('CRIAR_TAMANHO')}"
					title="#{rsc.title_salvar}" />

				<p:commandButton value="#{rsc.label_salvarContinuar}"
					styleClass="botao" update="growl"
					action="#{manterTamanhoBean.salvarContinuar}" ajax="false"
					onclick="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);"
					rendered="#{p:ifGranted('CRIAR_TAMANHO')}"
					title="#{rsc.title_salvarContinuar}" />

				<p:commandButton value="#{rsc.label_cancelar}" styleClass="botao"
					update="growl" action="#{manterTamanhoBean.cancelar}" ajax="false"
					onclick="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);"
					title="#{rsc.title_cancelar}" immediate="true">
				</p:commandButton>

			</p:panelGrid>

			<p:panel id="pnlNovoTamanho" header="#{rsc.label_novoTamanho}"
				toggleable="true" toggleSpeed="500">

				<p:panelGrid columns="2">
					<p:outputLabel value="#{rsc.label_tamanho}" for="txtNomeTamanho"
						styleClass="obrigatorio" />

					<p:inputText label="#{rsc.label_tamanho}" id="txtNomeTamanho"
						maxlength="60" size="40" title="#{rsc.label_tamanho}"
						value="#{manterTamanhoBean.entidade.nome}" />

					<p:outputLabel value="#{rsc.label_ativo}" for="chkAtivo" />

					<p:selectBooleanCheckbox label="#{rsc.label_ativo}" id="chkAtivo"
						title="#{rsc.label_ativo}"
						value="#{manterTamanhoBean.entidade.ativo}" />

				</p:panelGrid>
			</p:panel>
			<p:watermark value="#{rsc.wm_nomeTamanho}" for="txtNomeTamanho" />
		</h:form>
	</ui:define>
</ui:composition>

